URL
https://pomb.us/build-your-own-react/
Timestamp
2019-11-14 at 2.17.46 PM
Window title
Build your own React
App title
Google Chrome
Text
Cc

@ pomb.us/build-your-own-react/

const element

<hl1 title="foo">Hello</h1>

 

or)UY
Let’s remove all the React specific code and replace
it with vanilla JavaScript.

On the first line we have the element, defined with
JSX. It isn’t even valid JavaScript, so in order to
replace it with vanilla JS, first we need to replace it
with valid JS.

JSX is transformed to JS by build tools like Babel. The
transformation is usually simple: replace the code
inside the tags with acall to createElement ,
passing the tag name, the props and the children as
parameters.

React .createElement creates an object from its
arguments. Besides some validations, that’s all it
does. So we can safely replace the function call with
its output.

&y

fh

created-by-Screenotate